package org.mogu.tools;

import java.util.HashMap;

import org.mogu.service.GetSyncUrl;
import org.mogu.staticvalue.Convert;

public class UrlSync {
	private String uri=null;
	public static final String HTTP="http://";
	public static final String GET="get";
	public static final String POST="post";
	public static final String INFOALL="infoall";
	public static final String INFOUPDATE="infoupdate";
	public static final String INFOALLIMG="infoallimg";
	public static final String INFOSEND="infosend";
	private String modth=GET;
	private String urlparam="";
	private HashMap<String, String> prarm=null;
	private String resultType=null;
	private String syncType=INFOSEND;
	private String maincode="main";
	private String code=null;
	private boolean isNotice=false;
	private String noticeTitle=null;
	private String noticeContent=null;
	private String noticeCode=null;
	
	private String toastContentSu=null;
	private String toastContentFa=null;
	private boolean isToast=true;
	
	private String result=null;
	
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	public boolean isGet(){
		if(GET.equals(this.modth)){
			return true;
		}
		return false;
	}
	public String getUri() {
		return uri;
	}
	public String getAllUri(){
		return uri+"?UserName="+ Convert.uname + "&UserPwd=" + Convert.upwd+Convert.testNum+GetSyncUrl.getUserParamByCode(maincode)+urlparam;
	}

	public void setUri(String uri) {
		String[] uriarr=null;
		if(uri.indexOf(",")!=-1){
			uriarr=uri.split(",");
		}
		if(uriarr==null){
			if(uri.indexOf(HTTP)!=0){
				this.uri=HTTP+uri;
			}else{
			this.uri = uri;
			}
		}else{
			if(uriarr[0].indexOf(HTTP)!=0){
				this.uri=HTTP+uriarr[0];
			}else{
			this.uri = uriarr[0];
			}
			this.maincode=uriarr[1];
		}
		
	}

	public String getModth() {
		return modth;
	}

	public void setModth(String modth) {
		this.modth = modth;
	}

	public HashMap<String, String> getPrarm() {
		return prarm;
	}

	public void setPrarm(HashMap<String, String> prarm) {
		this.prarm = prarm;
	}

	public String getResultType() {
		return resultType;
	}

	public void setResultType(String resultType) {
		this.resultType = resultType;
	}

	public String getSyncType() {
		return syncType;
	}

	public void setSyncType(String syncType) {
		this.syncType = syncType;
	}

	public String getMaincode() {
		return maincode;
	}

	public void setMaincode(String maincode) {
		this.maincode = maincode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	
	
	public UrlSync() {
	}
	public boolean isNotice() {
		return isNotice;
	}
	public void setNotice(boolean isNotice) {
		this.isNotice = isNotice;
	}
	public String getNoticeTitle() {
		return noticeTitle;
	}
	public void setNoticeTitle(String noticeTitle) {
		this.noticeTitle = noticeTitle;
	}
	public String getNoticeContent() {
		return noticeContent;
	}
	public void setNoticeContent(String noticeContent) {
		this.noticeContent = noticeContent;
	}
	public String getUrlparam() {
		return urlparam;
	}
	public void setUrlparam(String urlparam) {
		this.urlparam = urlparam;
	}
	public String getNoticeCode() {
		return noticeCode;
	}
	public void setNoticeCode(String noticeCode) {
		this.noticeCode = noticeCode;
	}
	public String getToastContentSu() {
		return toastContentSu;
	}
	public void setToastContentSu(String toastContentSu) {
		this.toastContentSu = toastContentSu;
	}
	public String getToastContentFa() {
		return toastContentFa;
	}
	public void setToastContentFa(String toastContentFa) {
		this.toastContentFa = toastContentFa;
	}
	public boolean isToast() {
		return isToast;
	}
	public void setToast(boolean isToast) {
		this.isToast = isToast;
	}
	
}
